* Journal of Behavioral Public Administration 
* The role of organized groups in the administrative burdens of property taxation
* Iuliia Shybalkina

global path 

use data.dta, clear

* Table 1 Means and standard deviations of the variables, 2017
* NYC
est clear 
estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue if taxyear==2017 & nyc==1 & condo==0
matrix mean1=e(mean)
matrix mean1sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue ratio if taxyear==2017 & nyc==1 & condo==0 & ratio!=.
matrix mean2=e(mean)
matrix mean2sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue if taxyear==2017 & nyc==1 & condo==1
matrix mean3=e(mean)
matrix mean3sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue ratio if taxyear==2017 & nyc==1 & condo==1 & ratio!=.
matrix mean4=e(mean)
matrix mean4sd=e(sd)

estadd matrix mean1
estadd matrix mean1sd
estadd matrix mean2
estadd matrix mean2sd
estadd matrix mean3
estadd matrix mean3sd
estadd matrix mean4
estadd matrix mean4sd

esttab, noobs cells("mean1(fmt(3)) mean1sd(fmt(3) par)  mean2(fmt(3)) mean2sd(fmt(3) par)  mean3(fmt(3)) mean3sd(fmt(3) par)  mean4(fmt(3)) mean4sd(fmt(3) par)") ///
collabels ("All" ""  "Recently sold" "" "All" "" "Recently sold" "") ///
mgroups("Houses" "Condominium units" , pattern(1 0 0 0 1 0 0 0)) ///
title("Table 1 Means and standard deviations of the variables, NYC, 2017") ///
nonumbers ///
varlabels (appeal "Appeal" assess "Estimated value, $1,000"  exempt "Exemption" cap "Assessment cap" units "N of families (per property)" totlots  "N of units (per condo)" agebldg "Property age, years" sqfoot "Property area, 1,000 sq. feet"  over65per "65 and over" hispper "Hispanic"  blackper "Black" baper "Bachelor's or higher"  medincome "Median income, $1,000" ownerper "Homeowners" medvalue "Median home value, $1,000" ratio "Assessment ratio")

tab condo if taxyear==2017 & nyc==1
tab condo if taxyear==2017 & nyc==1 & ratio!=.


* AC
est clear 
estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue if taxyear==2017 & nyc==0 & condo==0
matrix mean1=e(mean)
matrix mean1sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue ratio if taxyear==2017 & nyc==0 & condo==0 & ratio!=.
matrix mean2=e(mean)
matrix mean2sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue if taxyear==2017 & nyc==0 & condo==1
matrix mean3=e(mean)
matrix mean3sd=e(sd)

estpost sum appeal assess exempt cap units totlots agebldg sqfoot over65per hispper blackper baper medincome ownerper medvalue ratio if taxyear==2017 & nyc==0 & condo==1 & ratio!=.
matrix mean4=e(mean)
matrix mean4sd=e(sd)

estadd matrix mean1
estadd matrix mean1sd
estadd matrix mean2
estadd matrix mean2sd
estadd matrix mean3
estadd matrix mean3sd
estadd matrix mean4
estadd matrix mean4sd

esttab, noobs cells("mean1(fmt(3)) mean1sd(fmt(3) par)  mean2(fmt(3)) mean2sd(fmt(3) par)  mean3(fmt(3)) mean3sd(fmt(3) par)  mean4(fmt(3)) mean4sd(fmt(3) par)") ///
collabels ("All" ""  "Recently sold" "" "All" "" "Recently sold" "") ///
mgroups("Houses" "Condominium units" , pattern(1 0 0 0 1 0 0 0)) ///
title("Table 1 Means and standard deviations of the variables, AC, 2017") ///
nonumbers ///
varlabels (appeal "Appeal" assess "Estimated value, $1,000"  exempt "Exemption" cap "Assessment cap" units "N of families (per property)" totlots  "N of units (per condo)" agebldg "Property age, years" sqfoot "Property area, 1,000 sq. feet"  over65per "65 and over" hispper "Hispanic"  blackper "Black" baper "Bachelor's or higher"  medincome "Median income, $1,000" ownerper "Homeowners" medvalue "Median home value, $1,000" ratio "Assessment ratio")

tab condo if taxyear==2017 & nyc==0
tab condo if taxyear==2017 & nyc==0 & ratio!=.

*-------------------------------------------------------------------------------

* Figure 1 Locally weighted regression estimates of assessment ratios on sales prices, 2017
gen stat = 0.06 if nyc==1 & taxyear==2017 & ratio!=.
replace stat = 0.87 if nyc==0 & taxyear==2017 & ratio!=.
gen ratiost = (ratio - stat)/stat *100

egen mean = mean(adjprice) if taxyear==2017, by(nyc) 
egen sd = sd(adjprice) if taxyear==2017, by(nyc)
gen zadjprice = (adjprice - mean)/sd

lowess ratiost zadjprice if nyc==1 & taxyear==2017, ///
title("New York City") ///
xtitle("Sales price, Z-score") ///
ytitle("Assessment ratio, Percentage change from the statutory ratio") ///
yline(0, lp(dash)) xlabel (, grid) ///
msize(vtiny) ///
scheme(s2mono) graphregion(color(white)) ///
saving (nyc, replace)

lowess ratiost zadjprice if nyc==0 & taxyear==2017, ///
title("Allegheny County") ///
xtitle("Sales price, Z-score") ///
ytitle("Assessment ratio, Percentage change from the statutory ratio") ///
yline(0, lp(dash)) xlabel (, grid) ///
msize(vtiny) scheme(s2mono) graphregion(color(white))  ///
saving (pit, replace)

graph combine nyc.gph pit.gph, iscale(*0.75) graphregion(color(white)) xcommon ycommon

*-------------------------------------------------------------------------------

* Figure 2 Appeal rate
gen pit = 1 if nyc==0 
replace pit = 0 if nyc==1
label define pitl 1 "Allegheny County" 0 "New York City"
label define condol 1 "Condos" 0 "Houses"
label values pit pitl
label values condo condol
graph bar (mean) appeal, over (taxyear) over(condo, label(labs(vsmall))) over(pit)  ytitle("Appeal rate") legend(rows(1) region(lc(white))) blab(bar, format(%9.3f) size(vsmall)) ///
ylabel(, nogrid) scheme(s2mono) graphregion(color(white))

*-------------------------------------------------------------------------------

* Table 2 Logistics estimates of appeal determinants in NYC
logit appeal  1.condo i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store ap
logit appeal  1.condo assessl exempt cap units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store apc
logit appeal  1.condo assessl ratio exempt cap units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel  i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store aps

gen totlots2 = totlots
replace totlots2 = 0 if condo==0

logit appeal  1.condo totlots2  i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store ap2
logit appeal  1.condo totlots2 assessl exempt cap units  agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store apc2
logit appeal  1.condo totlots2 assessl ratio exempt cap units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel  i.taxyear if nyc==1, cluster(tract2010) cformat(%9.3f)  difficult
est store aps2

# delimit ;
esttab ap ap2 apc apc2 aps aps2, se  ///
mgroups("Full sample" "Recently sold properties", pattern(1 0 0 0 1 0)) nonumbers ///
varlabels (1.condo "Condo"  totlots2 "N of units"  ///
assessl "Estimated value, log" ratio "Assessment ratio" exempt "Exemption" cap "Assessment cap" units "N of families"  agebldg "Property age" sqfootl "Property area, log"  /// 
over65per "65 and over" hispper "Hispanic" blackper "Black" baper "Bachelor's or higher" medincomel "Median income, log" ownerper   "Homeowners" medvaluel "Median home value, log"   ///
_cons "Constant") ///
drop(*.taxyear) ///
collabels(none)
b(%9.3f)
stats(N r2_p, fmt(%9.3g) labels("N" "Pseudo R-squared"))
wrap varwidth(30) modelwidth(10)
legend note("Standard errors clustered by census tract appear in parentheses below the coefficients. Year fixed effects are included.");
# delimit cr

*-------------------------------------------------------------------------------

* Table 3 Logistics estimates of appeal determinants in Allegheny County
logit appeal  1.condo i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store ap
logit appeal  1.condo assessl exempt units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store apc
logit appeal  1.condo assessl ratio exempt units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel  i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store aps

logit appeal  1.condo totlots2  i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store ap2
logit appeal  1.condo totlots2 assessl exempt units  agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store apc2
logit appeal  1.condo totlots2 assessl ratio exempt units agebldg sqfootl ///
over65 hispper blackper baper medincomel   ownerper medvaluel  i.taxyear if nyc==0, cluster(tract2010) cformat(%9.3f)  difficult
est store aps2

# delimit ;
esttab ap ap2 apc apc2 aps aps2, se  ///
mgroups("Full sample" "Recently sold properties", pattern(1 0 0 0 1 0)) nonumbers ///
varlabels (1.condo "Condo"  totlots2 "N of units"  ///
assessl "Estimated value, log" ratio "Assessment ratio" exempt "Exemption" units "N of families"  agebldg "Property age" sqfootl "Property area, log"  /// 
over65per "65 and over" hispper "Hispanic" blackper "Black" baper "Bachelor's or higher" medincomel "Median income, log" ownerper   "Homeowners" medvaluel "Median home value, log"   ///
_cons "Constant") ///
drop(*.taxyear) ///
collabels(none)
b(%9.3f)
stats(N r2_p, fmt(%9.3g) labels("N" "Pseudo R-squared"))
wrap varwidth(30) modelwidth(10)
legend note("Standard errors clustered by census tract appear in parentheses below the coefficients. Year fixed effects are included.");
# delimit cr

